﻿#pragma once

#include <iostream>
#include <vector>
#include <map>

#include <iguana/json.hpp>
#include "json.hpp"

using namespace std;

namespace bz
{
	enum class  DEVICE_TYPE {
		SMC = 1,
		TERMINAL = 2,
	};

	struct device_type_stru{
		DEVICE_TYPE id;
		std::string name;
	};
	
	class device
	{
	public:
		int id;
		int parent_id; //父id
		string name;
		int device_type; //终端类型
		string ip;
		bool online_state=false;
		string net_ip;
		string camera_ip;
		int meet_num;
		string sc_ip;
		string user;
		string pwd;
		string protocol;
		device();
		~device();

		std::pair<int, string> index(int page,string name,int parent_id);
		int add();
		bool remove();
		int update();
		void init();
		bool get();
		
		std::vector<bz::device_type_stru> device_type_vec_;

		NLOHMANN_DEFINE_TYPE_INTRUSIVE(device, id, parent_id, name, device_type, ip, online_state, net_ip, camera_ip, meet_num, sc_ip, user, pwd, protocol)
	private:

		
	};

	REFLECTION(device, id, parent_id, name, device_type, ip,  camera_ip, meet_num, sc_ip, user, pwd, protocol)

	
	
}